package com.yuanfengerp.suppliersettlement.controller;


import com.yuanfengerp.publicUtil.Result;
import com.yuanfengerp.suppliersettlement.moudel.SupplierSettlementInfo;
import com.yuanfengerp.suppliersettlement.service.impl.SupplierSettlementServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class SupplierSettlementController {
    @Autowired
    private SupplierSettlementServiceImpl sssi;
    @GetMapping("/selectAllSupplierSettlement")
    public Result<List<SupplierSettlementInfo>> selectAllSupplierSettlement(){
        return sssi.selectAllSupplierSettlement();
    }

    @PostMapping("/deleteSupplierSettlement")
    public Result<String> deleteSupplierSettlement(String supplier_settlement_ID){
        return sssi.deleteByPrimaryKey(supplier_settlement_ID);
    }
    @PostMapping("/insertSupplierSettlement")
    public Result<String> insertSupplierSettlement(@RequestBody SupplierSettlementInfo supplierSettlementInfo){
        System.out.println("supplierSettlementInfo: " + supplierSettlementInfo);
        return sssi.insertSupplierSettlement(supplierSettlementInfo);
    }
    @PostMapping("/updateSupplierSettlement")
    public Result<String> updateSupplierSettlement(SupplierSettlementInfo supplierSettlementInfo){
        return sssi.updateSupplierSettlement(supplierSettlementInfo);
    }
    @PostMapping("/selectSupplierSettlement")
    public Result<List<SupplierSettlementInfo>> selectSupplierSettlement(@RequestBody Map<String, Object> params){
        return sssi.selectSupplierSettlement(params);
    }
    @PostMapping("/batchdeleteSupplierSettlement")
    public Result<String> batchdelete(@RequestBody ArrayList<String> supplier_settlement_IDs){
        return sssi.batchdelete(supplier_settlement_IDs);
    }
    @PostMapping("/batchreviewSupplierSettlement")
    public Result<String> batchreview(@RequestBody ArrayList<String> supplier_settlement_IDs){
        return sssi.batchreview(supplier_settlement_IDs);
    }
    @PostMapping("/selectSupplierSettlementItemInfo")
    public Result<SupplierSettlementInfo> selectSupplierSettlementItemInfo(String supplier_settlement_ID){
        System.out.println("supplier_settlement_ID: " + supplier_settlement_ID);
        return sssi.selectSupplierSettlementItemInfo(supplier_settlement_ID);
    }
}
